$OpenBSD: patch-libk3bdevice_k3bdevice_cpp,v 1.2 2010/05/20 15:24:24 naddy Exp $
--- libk3bdevice/k3bdevice.cpp.orig	Fri Nov  2 08:13:54 2007
+++ libk3bdevice/k3bdevice.cpp	Thu May 20 09:06:54 2010
@@ -65,8 +65,9 @@ typedef unsigned char u8;
 #define CD_FRAMESIZE_RAW 2352
 #endif
 
-#ifdef Q_OS_NETBSD
+#if defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD)
 #include <sys/cdio.h>
+#include <sys/dkio.h>
 #endif
 
 #ifdef HAVE_RESMGR
@@ -106,7 +107,7 @@ const char* K3bDevice::Device::cdrdao_drivers[] =
   };
 
 
-#if defined(Q_OS_LINUX) || defined(Q_OS_NETBSD)
+#if defined(Q_OS_LINUX) || defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD)
 int K3bDevice::openDevice( const char* name, bool write )
 {
   int fd = -1;
@@ -149,7 +150,7 @@ class K3bDevice::Device::Private (public)
 #ifdef Q_OS_LINUX
       deviceFd(-1),
 #endif
-#ifdef Q_OS_NETBSD
+#if defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD)
       deviceFd(-1),
 #endif
 #ifdef Q_OS_FREEBSD
@@ -166,7 +167,7 @@ class K3bDevice::Device::Private (public)
 #ifdef Q_OS_LINUX
   int deviceFd;
 #endif
-#ifdef Q_OS_NETBSD
+#if defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD)
   int deviceFd;
 #endif
 #ifdef Q_OS_FREEBSD
@@ -1494,7 +1495,7 @@ bool K3bDevice::Device::block( bool b ) const
     usageUnlock();
     if ( success )
         return success;
-#elif defined(Q_OS_NETBSD)
+#elif defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD)
     bool success = false;
     bool needToClose = !isOpen();
     int arg = b ? 1 : 0;
@@ -1542,7 +1543,7 @@ bool K3bDevice::Device::rewritable() const
 
 bool K3bDevice::Device::eject() const
 {
-#ifdef Q_OS_NETBSD
+#if defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD)
     bool success = false;
     bool needToClose = !isOpen();
     int arg = 0;
@@ -1591,7 +1592,7 @@ bool K3bDevice::Device::eject() const
 
 bool K3bDevice::Device::load() const
 {
-#ifdef Q_OS_NETBSD
+#if defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD)
     bool success = false;
     bool needToClose = !isOpen();
     int arg = 0;
@@ -1690,7 +1691,7 @@ bool K3bDevice::Device::open( bool write ) const
 
   return (d->cam != 0);
 #endif
-#if defined(Q_OS_LINUX) || defined(Q_OS_NETBSD)
+#if defined(Q_OS_LINUX) || defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD)
   if( d->deviceFd == -1 )
     d->deviceFd = openDevice( QFile::encodeName(devicename()), write );
 
@@ -1709,7 +1710,7 @@ void K3bDevice::Device::close() const
     d->cam = 0;
   }
 #endif
-#if defined(Q_OS_LINUX) || defined(Q_OS_NETBSD)
+#if defined(Q_OS_LINUX) || defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD)
   if( d->deviceFd != -1 ) {
     ::close( d->deviceFd );
     d->deviceFd = -1;
@@ -1723,7 +1724,7 @@ bool K3bDevice::Device::isOpen() const
 #ifdef Q_OS_FREEBSD
   return d->cam;
 #endif
-#if defined(Q_OS_LINUX) || defined(Q_OS_NETBSD)
+#if defined(Q_OS_LINUX) || defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD)
   return ( d->deviceFd != -1 );
 #endif
 }
@@ -3624,7 +3625,7 @@ QCString K3bDevice::Device::mediaId( int mediaType ) c
 // int K3bDevice::Device::ioctl( int request, ... ) const
 // {
 //     int r = -1;
-// #if defined(Q_OS_LINUX) || defined(Q_OS_NETBSD)
+// #if defined(Q_OS_LINUX) || defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD)
 //     d->mutex.lock();
 
 //     va_list ap;
